
/*
 * .
 * All Rights Reserved.
 */
package com.model.demo.designmodel.singleton;

/**
 * ThreadLocalSingleton
 *
 * @author Liao Dongshan, 2019年05月13日
 *
 */
public class ThreadLocalSingleton {
    private ThreadLocalSingleton(){};
    private static ThreadLocal<ThreadLocalSingleton> newthreadLocal=
            new ThreadLocal<ThreadLocalSingleton>(){
        @Override
        protected ThreadLocalSingleton initialValue() {
            return new ThreadLocalSingleton();
        }
    };

    public static ThreadLocalSingleton getInstance(){
        return newthreadLocal.get();
    }


}
